package by.airlanterns.dao;

import by.airlanterns.dto.UserOrder;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Sergey
 * Date: 30.01.13
 * Time: 19:24
 * To change this template use File | Settings | File Templates.
 */
@Controller
public class OrderDaoImpl extends GenericDaoImpl<UserOrder, Integer> {

    @Override
    protected Class<UserOrder> getEntityClass() {
        return UserOrder.class;
    }

    public List<UserOrder> getOrdersByUser(int uId) {
        return getHibernateTemplate().find("from " + UserOrder.class.getName() + " where fk_id_user=" + uId);
    }
}
